Skip to content

Conversation

@jdoucett
Copy link
Contributor

What

When a resume run finds a staged zip that turns out to be unusable/scratch purged it, a crash left a 0-byte stub, or it's corrupt — archive.py used to hard-fail with an alert email and sys.exit(1). That burns the resume watchdog's retry budget on a self-healing condition and can strand an experiment with nothing on Fortress (this is what happened to X0H_Soy).

This change makes that path self-heal: an unusable resume candidate is removed and the run re-zips fresh from the (intact) /depot source, which is correct and complete.

How

  • find_existing_zip now skips candidates that don't exist or are zero-byte.
  • New try_reconstruct(existing_zip, runner) wraps reconstruct_from_zip; on any exception it logs [RESUME] Candidate unusable …, removes the bad zip, and returns None so the caller falls through to a fresh zip.
  • __main__ resume block: a None result clears existing_zip and proceeds to re-zip instead of exiting.

Tests

tests/test_resume_fallback.py (+6 tests): corrupt zip, missing/purged zip, and 0-byte stub all fall back to a fresh re-zip rather than aborting. Full suite green: 43 tests, OK.

Notes

Independent of the incremental/size-routing redesign — a standalone production bug fix. Rebases cleanly onto current main (verified; #5/#6 net to ~no-op on archive.py).

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com

🤖 Generated with Claude Code

… hard-failing

A scratch-purged, zero-byte (partial-write), or corrupt resume zip is fully
recoverable — the source on /depot is intact, so the run should just re-zip
from it. Previously reconstruct_from_zip's failure hard-exited (sys.exit 1) and
emailed a FAILED alert, which burned the resume watchdog's retry budget on a
self-healing condition and stranded the experiment with nothing on Fortress
(X0H_Soy: 5.5 TB never archived; watchdog attempts maxed at 3).

- find_existing_zip: skip candidates that don't exist or are zero-byte, so a
  purged/partial stub is never offered as a resume source.
- try_reconstruct(existing_zip, runner): new helper — returns the rebuilt tuple,
  or None (after removing the bad zip) when the candidate is unusable, so the
  caller falls through to a fresh make_zip_files.
- main(): a None result re-zips fresh instead of exiting. The staleness guard
  (incomplete-snapshot protection) is unchanged.

Tests: tests/test_resume_fallback.py (find_existing_zip skip-logic;
try_reconstruct valid/missing/corrupt). Full suite 43 green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jdoucett Jarrod S Doucette (jdoucett) deleted the fix/resume-fallback-fresh-zip branch June 30, 2026 20:09
Sign in to join this conversation on GitHub.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant